#ifndef SCALE_H
#define SCALE_H
#include <QtSerialPort/QSerialPort>
#include <QtSerialPort/QSerialPortInfo>
#include <QtCore/QDebug>
#include <QThread>
#include <QString>
#include <QObject>
#include <QtCore>
#include <QTimer>
class Scale: public QObject
{
    Q_OBJECT
public:
    explicit Scale(QObject *parent = 0);
    ~Scale();
    float ReadKG();
    void  clear();

private:
     QSerialPort *serial;
     float kg;
     QTimer *m_timer,*m_timer2;
     bool quit;

     QMutex mutex;
     float kg_old,kg_new,kg_oldsta;
     int stable,ready,comp;
     int count;
     QString txt;


public slots:
   void time_chack();
   void  ReadData();

 \

};


#endif // SCALE_H
